let Mock = require("mockjs")
let data = [
    {
        date: "011 - 考试",
        name: "王小虎",
        address: "16",
        tag: "家",
        jige: "60",
        rengong: "否",
        kaifang: "不限时",
    },
    {
        date: "011 - 考试",
        name: "王小虎",
        address: "16",
        tag: "家",
        jige: "60",
        rengong: "否",
        kaifang: "不限时",
    },
    {
        date: "011 - 考试",
        name: "王小虎",
        address: "16",
        tag: "家",
        jige: "60",
        rengong: "否",
        kaifang: "不限时",
    },{
        date: "011 - 考试",
        name: "王小虎",
        address: "16",
        tag: "家",
        jige: "60",
        rengong: "否",
        kaifang: "不限时",
    },{
        date: "011 - 考试",
        name: "王小虎",
        address: "16",
        tag: "家",
        jige: "60",
        rengong: "否",
        kaifang: "不限时",
    },

]
Mock.mock("/api/homeindex", "get", function (config) {
    return data
})
Mock.mock(/\/api\/homeindex\/\d/, "delete", function (config) {
    console.log(config.url);
    let arr = config.url.split("/")
    let id = arr.pop()
    data.splice(id, 1)
    data.forEach(function(item,index){
        item.id = index
    })
    return data
})